import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmissionContractVO, AdmissionContractForm, AdmissionContractQuery } from '@/api/nursing/admissionContract/types';

/**
 * 查询入住合同111列表
 * @param query
 * @returns {*}
 */

export const listAdmissionContract = (query?: AdmissionContractQuery): AxiosPromise<AdmissionContractVO[]> => {
  return request({
    url: '/nursing/admissionContract/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询入住合同111详细
 * @param contractId
 */
export const getAdmissionContract = (contractId: string | number): AxiosPromise<AdmissionContractVO> => {
  return request({
    url: '/nursing/admissionContract/' + contractId,
    method: 'get'
  });
};

/**
 * 新增入住合同111
 * @param data
 */
export const addAdmissionContract = (data: AdmissionContractForm) => {
  return request({
    url: '/nursing/admissionContract',
    method: 'post',
    data: data
  });
};

/**
 * 修改入住合同111
 * @param data
 */
export const updateAdmissionContract = (data: AdmissionContractForm) => {
  return request({
    url: '/nursing/admissionContract',
    method: 'put',
    data: data
  });
};

/**
 * 删除入住合同111
 * @param contractId
 */
export const delAdmissionContract = (contractId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/admissionContract/' + contractId,
    method: 'delete'
  });
};
